<?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

require_once(dirname(__FILE__).'/../lib/BasesfMediaLibraryActions.class.php');

/**
 *
 * @package    symfony
 * @subpackage plugin
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @version    SVN: $Id: actions.class.php 1949 2006-09-05 14:40:20Z fabien $
 */
class sfMediaLibraryActions extends BasesfMediaLibraryActions
{
  protected
    $useMiniatures = false,
    $miniaturesDir = '',
    $miniaturesWidth,
    $miniaturesHeight,
    $useRootFolder = false,
    $rootFolder = '';
  
  public function preExecute()
  {
    if (sfConfig::get('app_sfMediaLibrary_useMiniatures', true) 
    and class_exists('sfThumbnail'))
    {
      $this->useMiniatures = true;
      $this->miniaturesDir = sfConfig::get('app_sfMediaLibrary_miniaturesDir', 'miniature');
      $this->miniaturesWidth = sfConfig::get('app_sfMediaLibrary_miniaturesWidth', 200);
      $this->miniaturesHeight = sfConfig::get('app_sfMediaLibrary_miniaturesHeight', 200);
    }
    if (sfConfig::get('app_sfMediaLibrary_useRootFolder', true))
    {
      $this->useRootFolder = true;
      $this->rootFolder = '/'.sfConfig::get('app_sfMediaLibrary_rootFolder', 'admin');
    }
    parent::preExecute();
  }
}
